diff options
Diffstat (limited to 'src/routes/projects/[projectId]/routine/[routineId]/+page.server.ts')
| -rw-r--r-- | src/routes/projects/[projectId]/routine/[routineId]/+page.server.ts | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/routes/projects/[projectId]/routine/[routineId]/+page.server.ts b/src/routes/projects/[projectId]/routine/[routineId]/+page.server.ts index cb14e0d..4ace86f 100644 --- a/src/routes/projects/[projectId]/routine/[routineId]/+page.server.ts +++ b/src/routes/projects/[projectId]/routine/[routineId]/+page.server.ts @@ -1,6 +1,5 @@ import { error } from '@sveltejs/kit'; -import { getById } from '$lib/server/services/projects'; -import { loadCurrent, loadCompletions } from '$lib/server/services/routines'; +import { projectsService, routinesService } from '$lib/server/services'; import { archiveRoutineAction, completeRoutineAction, @@ -14,17 +13,17 @@ export const load: PageServerLoad = async ({ params }) => { const projectId = numericId(params.projectId); const routineId = numericId(params.routineId); - const project = await getById(projectId); + const project = await projectsService.getById(projectId); if (!project || project.archived) { throw error(404, 'Projet introuvable'); } - const routine = await loadCurrent(routineId); + const routine = await routinesService.loadCurrent(routineId); if (!routine || routine.projectId !== projectId) { throw error(404, 'Routine introuvable'); } - const completions = await loadCompletions(routineId); + const completions = await routinesService.loadCompletions(routineId); // Archived routines are frozen at their archive instant, not now. const at = routine.archivedAt ? Temporal.Instant.from(routine.archivedAt) |
